<template>
  <div class="mainContent">
    <!-- <div>
      <div class="block">
        <div><img src="http://img3.epanshi.com/14472/upload/top/sy-banner-08.jpg" alt=""></div>
      </div>
    </div> -->
    <div class="title">
      <div @click="chooseHandle()">知识产权</div>
      <div class="active">商标买卖</div>
    </div>
    <div class="contentList">
      <div class="contentRight">
        <ul>
          <li v-for="item in list" :key="item.id" @click="findDetail(item.id)">
            <span class="img"><img src="../assets/imgs/right.png" alt=""></span>
            <span>{{item.bt}}</span>
            <span class="floatRight">{{filterTime(item.time)}}</span>
          </li>
        </ul>
      </div>
    </div>
    <div class="pageSize">
      <el-pagination
        :current-page="currentPage"
        @current-change="handleCurrentChange"
        :pager-count="7"
        layout="total, prev, pager, next"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
import moment from "moment"
export default {
  name: 'IntellectualProperty',
  data () {
    return {
      list: [],
      pagesize: 10,
      currentPage: 1,
      total: 0,
    }
  },
  mounted () {
    this.getBrand()
  },
  methods: {
    chooseHandle () {
      this.$router.push('/intellectualProperty')
    },
    findDetail (id) {
      const newRoute = this.$router.resolve({path: '/detail', query: {id: id, type: 2}})
      window.open(newRoute.href,'_self')
    },
    getBrand () {
      this.$http({
        method: 'post',
        url: this.api.POST_BRANDDETAIL_LIST + '?pageSize=' + this.pagesize + '&pageNum=' + this.currentPage,
        data: {
          // pageSize: '1',
          // pageNum: '8'
        }
      }).then(res => {
        console.log(res)
        this.list = res.data.data
        this.total = res.data.code || 0
      })
    },
    filterTime (val) {
      return moment(val).format('YYYY-MM-DD HH:mm:ss')
    },
    handleCurrentChange: function (currentPage) {
      this.currentPage = currentPage
      this.getBrand()
    }
  }
}
</script>
<style scoped>
.block{
  height: 100%;
  width: 100%;
}
.block img{
  height: 100%;
  width: 100%;
}
.title {
  width: 1100px;
  margin: 30px auto 15px;

  height: 50px;
}
.title div{
  width: 50%;
  /* margin-left: 1%; */
  box-sizing: border-box;
  height: 50px;
  line-height: 50px;
  float: left;
  text-align: center;
  background: #eee;
  /* font-weight: bold; */
  font-size: 15px;
  color: #333;
  cursor: pointer;
}
.title div.active{
  background: #547d55;
  color: white;
}

.contentList {
  width: 1100px;
  box-sizing: border-box;
  margin: 15px auto;
}
.contentList .contentRight ul li {
  /* height: 42px; */
  line-height: 42px;
  border-bottom: 1px dashed #ccc;
  cursor: pointer;
  padding: 0px 137px 0px 36px;
  position: relative;
}
.contentList .contentRight ul li span {
  padding: 0px 5px;
}
.contentList .contentRight ul li span.floatRight{
  /* float: right; */
  color: #999;
  position: absolute;
  right:0px;
  top: 0px;
}
.img{
  position: absolute;
  left: 0px;
  top:0px;
}
.contentList .contentRight ul li img {
  width: 10px;
  height: 8px;
}
.pageSize {
  width: 100%;
  height: 60px;
  line-height: 60px;
  text-align: center;
}
.contentArticle {
  width: 1100px;
  box-sizing: border-box;
  margin: 15px auto;
}
.contentArticle .titleArticle{
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 30px;
  margin-top: 10px;
}
.contentArticle .timeArticle{
  text-align: center;
  font-size: 12px;
  color: #999;
  line-height: 15px;
}
.content{
  width: 1100px;
  padding: 20px;
  box-sizing: border-box;
  margin: 30px auto;
  border: 1px #D4D8D9 solid;
}
</style>
